package com.aboo.threadlocal;

import java.util.concurrent.TimeUnit;

public class SessionRunnable implements Runnable {

    public SessionRunnable() {
    }

    @Override
    public void run() {
        ThreadLocalFactory.setSession();

        for (int i = 0; i < 10; i++) {
            try {
                TimeUnit.SECONDS.sleep(2L);
                System.out.println("ThreadName:" + Thread.currentThread().getName() + ",session:" + ThreadLocalFactory.getSession());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

}
